# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
# Contributor: Jan de Groot <jgc@archlinux.org>
# Contributor: Giovanni Scafora <giovanni@archlinux.org>

pkgname=rhythmbox
pkgver=3.4.7
pkgrel=1
pkgdesc="Music playback and management application"
url="https://wiki.gnome.org/Apps/Rhythmbox"
arch=(loong64 x86_64)
license=(GPL)
depends=(
  dconf
  grilo
  gst-plugins-base
  gst-plugins-good
  json-glib
  libgudev
  libnotify
  libpeas
  libsoup3
  media-player-info
  python-gobject
  tdb
  totem-plparser
)
makedepends=(
  brasero
  git
  gobject-introspection
  gtk-doc
  libdmapsharing
  libgpod
  libmtp
  lirc
  meson
  vala
  yelp-tools
  zeitgeist
)
makedepends+=(
  check
  xorg-server-xvfb
)
optdepends=(
  'brasero: Audio CD Recorder plugin'
  'grilo-plugins: Grilo media browser plugin'
  'gst-libav: Extra media codecs'
  'gst-plugins-bad: Extra media codecs'
  'gst-plugins-ugly: Extra media codecs'
  'gvfs-mtp: Portable Players - Android plugin'
  'libdmapsharing: DAAP Music Sharing plugin'
  'libgpod: Portable Players - iPod plugin'
  'libmtp: Portable Players - MTP plugin'
  'lirc: LIRC plugin'
  'zeitgeist: Zeitgeist logging plugin'
)
_commit=1b4df30fcd66d2e9ff5a934f1ca3bfcbf3402847  # tags/v3.4.7^0
source=("git+https://gitlab.gnome.org/GNOME/rhythmbox.git#commit=$_commit")
b2sums=('SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/^v//;s/[^-]*-g/r&/;s/-/+/g'
}

prepare() {
  cd $pkgname
}

build() {
  local meson_options=(
    -D daap=enabled
    -D gtk_doc=true
  )

  arch-meson $pkgname build "${meson_options[@]}"
  meson compile -C build
}

check() {
  xvfb-run -s '-nolisten local' \
    meson test -C build --print-errorlogs -t 3
}

package() {
  meson install -C build --destdir "$pkgdir"

  python -m compileall -d /usr/lib "$pkgdir/usr/lib"
  python -O -m compileall -d /usr/lib "$pkgdir/usr/lib"
}

# vim:set sw=2 sts=-1 et:
